﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace TakeoutExpress2008.Web.MVC
{
    public partial class Dashboard : System.Web.UI.Page
    {
        private UserControls.SiteDashboardView svAvailableSites;
        private UserControls.SiteDashboardView svMySites ;
        protected void Page_Load(object sender, EventArgs e)
        {
            svAvailableSites = (UserControls.SiteDashboardView) this.lvSiteDashboardViewJoinSites.FindControl("svAvailableSites");
            svMySites = (UserControls.SiteDashboardView)this.lvSiteDashboardViewJoinSites.FindControl("svMySites");

            if (svAvailableSites != null)
                svAvailableSites.SiteViewRowCommand += new GridViewCommandEventHandler(svAvailableSites_SiteViewRowCommand);

            if (svMySites != null)
                svMySites.SiteViewRowCommand += new GridViewCommandEventHandler(svMySites_SiteViewRowCommand);
        }

        void svMySites_SiteViewRowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (svAvailableSites != null)
                svAvailableSites.PopulateGrid();
        }

        void svAvailableSites_SiteViewRowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (svMySites != null)
                svMySites.PopulateGrid();
        }

       
    }
}
